package com.union.official.common.util;

/**
 * @author jimmy
 * @description 启动环境
 * @date 2024-01-04 21:36:57
 */
public enum EnvProfileUtils {
	
    LOCAL("local", "本地环境"),
    DEV("dev", "开发环境"),
    DEV_K8S("dev-k8s", "k8s开发环境"),
    TEST("test", "测试环境"),
    TEST_K8S("test-k8s", "k8s测试环境"),
    UAT_K8S("uat-k8s", "k8s验收环境"),
    SHOW("pre", "预生产环境"),
    PROD("prod", "生产环境");

    public String name;
    public String value;  

    EnvProfileUtils(String name, String value) {
        this.name = name;
        this.value = value;  
    }

    public static EnvProfileUtils getValue(String name) {
        if (name != null && !"".equals(name)) {
            for (EnvProfileUtils env : EnvProfileUtils.values()) {
                if (env.getName().equals(name.toLowerCase())) {
                    return env;
                }
            }
        }
        throw new RuntimeException("error");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }  
    
}
